Skip to content
This repository was archived by the owner on Apr 20, 2021. It is now read-only.

Symfony 5 compatibility - #281

Merged
sanpii merged 2 commits into
Behatch:masterfrom
alanpoulain:sf5-compatibility
Feb 27, 2020
Merged

Symfony 5 compatibility#281
sanpii merged 2 commits into
Behatch:masterfrom
alanpoulain:sf5-compatibility

Conversation

@alanpoulain

Copy link
Copy Markdown
Contributor

Fixes #279.

The MinkExtension from Behat (https://github.com/Behat/MinkExtension) has been replaced by the one from FriendsOfBehat (https://github.com/FriendsOfBehat/MinkExtension) because it is more actively maintained (and supports Symfony 5).

@alanpoulain
alanpoulain force-pushed the sf5-compatibility branch 4 times, most recently from a4d9bd5 to fc811cd Compare February 26, 2020 12:34
@guelosuperstart

Copy link
Copy Markdown

Hello @alanpoulain,
Thank you for your PR, when will it be merged ?
Is It possible to use your branch: sf5-compatibility?

@alanpoulain

Copy link
Copy Markdown
Contributor Author

It doesn't depend on me, sorry.
Yes you should be able to use my branch with the right Composer configuration.

@guelosuperstart

Copy link
Copy Markdown

@alanpoulain : what is the right way to use with composer ?

thks

@alanpoulain
alanpoulain force-pushed the sf5-compatibility branch 17 times, most recently from 1985e36 to 6ab044d Compare February 26, 2020 21:45
@alanpoulain

Copy link
Copy Markdown
Contributor Author

And Travis should be green now!

@sanpii
sanpii merged commit e45284b into Behatch:master Feb 27, 2020
@sanpii

sanpii commented Feb 27, 2020

Copy link
Copy Markdown
Member

Thank you very much 🎉

@sanpii sanpii added this to the 3.3 milestone Feb 27, 2020
@guelosuperstart

Copy link
Copy Markdown

@alanpoulain Thank you very much for your PR.

i have just tested it on my SF5 project, but i have some problems :/

  Problem 1
    - behat/mink v1.7.1 requires symfony/css-selector ~2.1|~3.0 -> no matching package found.
    - behat/mink v1.7.0 requires symfony/css-selector ~2.1 -> no matching package found.
    - behat/mink v1.6.1 requires symfony/css-selector ~2.0 -> no matching package found.
    - behat/mink v1.6.0 requires symfony/css-selector ~2.0 -> no matching package found.
    - behat/mink v1.5.0 requires symfony/css-selector ~2.0 -> no matching package found.
    - friends-of-behat/mink-extension 2.3.1 requires symfony/config ^2.7|^3.0|^4.0 -> no matching package found.
    - behatch/contexts 3.3.0 requires friends-of-behat/mink-extension ^2.3.1 -> satisfiable by friends-of-behat/mink-extension[2.3.1, v2.4.0].
    - friends-of-behat/mink-extension v2.4.0 requires behat/mink ^1.5 -> satisfiable by behat/mink[v1.5.0, v1.6.0, v1.6.1, v1.7.0, v1.7.1].
    - Installation request for behatch/contexts ^3.3 -> satisfiable by behatch/contexts[3.3.0].

I use symfony/config v5.0.4in my project, but friends-of-behat/mink-extension:2.3.1 is not working with this package.

friends-of-behat/mink-extension:2.3.1 -> require symfony/config: ^2.7|^3.0|^4.0

is it possible to use the version 2.4.0 for friends-of-behat/mink-extension ?
friends-of-behat/mink-extension:2.4.0 -> require symfony/config: ^4.4|^5.0

@alanpoulain

Copy link
Copy Markdown
Contributor Author

@guelosuperstart you need to replace behat/mink (https://github.com/minkphp/Mink) with friends-of-behat/mink (https://github.com/FriendsOfBehat/Mink).

It tells Composer to replace the old package by itself (https://github.com/FriendsOfBehat/Mink/blob/28798f57e9674cb99750606807d623bbc0ae6db3/composer.json#L27).

Try to do this:

composer require --dev friends-of-behat/mink behatch/contexts

@guelosuperstart

guelosuperstart commented Feb 27, 2020

Copy link
Copy Markdown

Thank you @alanpoulain, I have just tested your solution and it works like a charm: D

So to use behat with behatch/contexts& mink in SF5 we should install like this :

composer require --dev friends-of-behat/mink friends-of-behat/mink-browserkit-driver behatch/contexts friends-of-behat/symfony-extension:v2.1.0-BETA.1

@adrienfr

Copy link
Copy Markdown

Hi,

Thank you for the SF5 compatibility!

Since Composer 1.10 release (here): I have the following deprecation notice message:

Warning: Ambiguous class resolution, "Behat\MinkExtension\Listener\SessionsListener" was found 2x: in "/var/www/morningcroissant/symfony/vendor/behat/mink-extension/src/Behat/MinkExtension/Listener/SessionsListener.php" and "/var/www/morningcroissant/symfony/vendor/friends-of-behat/mink-extension/src/Behat/MinkExtension/Listener/SessionsListener.php", the first will be used.

In composer.lock, I have :

  • behat/symfony2-extension which requires behat/mink-extension
  • behatch/contexts which requires friends-of-behat/mink-extension

Do you know how we can fix this?

Thanks

@alanpoulain

Copy link
Copy Markdown
Contributor Author

Symfony2Extension is not really maintained anymore. I suggest you to use https://github.com/FriendsOfBehat/SymfonyExtension instead.

@guelosuperstart

guelosuperstart commented Mar 11, 2020

Copy link
Copy Markdown

Hello @adrienfr ,

In my SF5 project, i have installed behat, behatch/contexts& mink like this:

composer require --dev friends-of-behat/mink friends-of-behat/mink-browserkit-driver behatch/contexts friends-of-behat/symfony-extension:v2.1.0-BETA.1

i use friends-of-behat/symfony-extension:v2.1.0-BETA.1 instead of Symfony2Extension

@adrienfr

Copy link
Copy Markdown

Thanks @alanpoulain & @guelosuperstart but I use behat/mink-selenium2-driver and there is no such thing in friends-of-behat/.

I tried to mix behat/mink-selenium2-driver with friends-of-behat/mink friends-of-behat/mink-browserkit-driver behatch/contexts friends-of-behat/symfony-extension but Selenium won't work:

AfterStep # Behatch\Context\DebugContext::failScreenshots()
Fatal error: Call to a member function screenshot() on null (Behat\Testwork\Call\Exception\FatalThrowableError)

AfterScenario # Behatch\Context\BrowserContext::closeBrowser()
Could not connect to a Selenium 2 / WebDriver server (Behat\Mink\Exception\DriverException)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Symfony 5 packages

4 participants